home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / public / GNU / emacs.inst / emacs19.idb / usr / gnu / lib / emacs / site-lisp / which.el.z / which.el
Encoding:
Text File  |  1994-08-02  |  778 b   |  18 lines

  1. ; WhereIs Commands
  2. (defun where-is-library (file arg)
  3.   "Find where the Emacs Lisp library FILE is in the current `load-path'.
  4. By default, appends \".el\" to the filename given, unless FILE already
  5. ends in \".el\" or \".elc\".  If a prefix argument is given, then no
  6. \".el\" prefix is given."
  7.   (interactive "sWhere is library: \nP")
  8.   (let ((path load-path)
  9.         (file (if (or arg (string-match ".elc?\\'" file))
  10.                   file
  11.                   (concat file ".el"))))
  12.     (while (and path (not (file-exists-p (concat (car path) "/" file))))
  13.       (setq path (cdr path)))
  14.     (if path
  15.         (message "File %s is in %s." file (car path))
  16.         (message "File %s not found." file))))
  17. ; -----------------------------------------------------------------------------
  18.